import { useLocation, matchRoutes } from "react-router-dom";
import Routes from "@/router/router-pages";

export function useRouteMeta() {
  const location = useLocation();
  const matchedRoutes = matchRoutes(Routes, location);
  return matchedRoutes?.[matchedRoutes.length - 1]?.route?.meta || {};
}
